package jpb.module.dao.department.mapper;

import jpb.module.daomain.department.Department;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Created by haol on 2017/4/5.
 */
@Component
public interface DepartmentMapper {

        void add(@Param("department") Department department);

        void delete(@Param("id") Integer id);

        void deleteByOid(@Param("oid") String oid);

        void updateLogo(@Param("department") Department department);

        Department get(@Param("id") Integer id);

        Department  getByOidAndId(@Param("oid") String oid,@Param("id") Integer id );

        List<Department> getByOid(@Param("oid") String oid);

        void update(@Param("department") Department department);

        Integer lastId();

        Department getByOidAndDname(@Param("oid") String oid, @Param("name") String name);

        List<Integer> getSon(@Param("id") int id);


        CopyOnWriteArrayList<Integer> getSons(@Param("id") int id);

        //List<Department> getByMNum(@Param("memberNum") String memberNum);

        List<Department> getLeaf(@Param("oid") String oid);


       // List<Department> getByOidConsTree(@Param("oid") String oid);

        Department getByOidAndNum(@Param("oid") String oid,
                                        @Param("memberNum") String memberNum);
}
